<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="br.com.locautowebbd.fabricante.Fabricante"%>
<%@page import="br.com.locautowebbd.fabricante.RepositorioFabricanteJDBC"%>
<%@page import="br.com.locautowebbd.fabricante.FabricanteExistenteException"%>
<%@page import="br.com.locautowebbd.fachada.Fachada"%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<% 

Fachada fachada = (Fachada)fachada.getInstancia();
int codigo  = Integer.parseInt(request.getParameter("codigo"));
String descricao= request.getParameter("descricao");

Fabricante fabricante = new Fabricante (codigo, descricao);

try{
	fachada.removerFabricante(codigo);
	%>
	   <jsp:forward page="menu.html" />

	<% }catch(FabricanteExistenteException ex){ %>

	  <jsp:forward page="leitorExistente.jsp" />

	<% } %>
 
</body>
</html>